﻿Public Class WebForm1
    Inherits System.Web.UI.Page
    Dim con As SqlServerCe.SqlCeConnection = New SqlServerCe.SqlCeConnection("Data Source='c:\users\mauhib\documents\visual studio 2010\Projects\WebApplication5\WebApplication5\App_Data\MyData.sdf'")

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        If WebTextEditor2.Text = WebTextEditor3.Text Then
            Dim cmd As SqlServerCe.SqlCeCommand = New SqlServerCe.SqlCeCommand("Insert Into Users (User_Nick, User_Pass) values ('" + WebTextEditor1.Text + "', '" + WebTextEditor2.Text + "')", con)
            con.Open()
            cmd.ExecuteNonQuery()
            con.Close()
            Label1.Text = "New Account Created"
            Label1.Visible = True
            Response.Redirect("login.aspx")
        Else
            Label1.Text = "Passwords do not match"
            Label1.Visible = True
        End If
    End Sub
End Class